#pragma once

namespace col {

//! A database exception class.
class DatabaseError : public std::exception
{
public:
	DatabaseError ( const wxString &rErrMsg, const wxString &rFile,
		const wxString &rQuery = "" );
	DatabaseError() { }
	virtual ~DatabaseError() throw();

	const wxString &GetMessage() const;
	const wxString &GetQuery() const;
	const wxString &GetFile() const;

	/*! @brief Overrides std::exception::what().
	 *
	 * @return A string containing all information about the
	 * error in a form that it can be directly displayed to the user.
	 **/
	const char *what() const throw();
private:
	//! The error message.
	wxString mErrMsg;
	//! The path to the database file.
	wxString mFile;
	//! The query that was executed when the error occured (if any).
	wxString mQuery;
};

}